package com.zhuang.combination;

/**
 * @Classname MenuItem
 * @Description 菜单选项 继承菜单组件
 * @Date 2021/3/24 17:10
 * @Created by dell
 */

public class MenuItem extends MenuComponent {

    public MenuItem(String name, int level) {
        this.name = name;
        this.level = level;
    }

    @Override
    public void print() {
        for (int i = 0; i < level; i++) {
            System.out.print("--");
        }
        System.out.println(name);
    }
}
